GXGetColorSetParts
You can use theGXGetColorSetParts
function to retrieve specified colors from a color set object.
long GXGetColorSetParts(gxColorSet source, long index, long count, gxColorSpace *space, gxSetColor data[]);
source
- A reference to the color set object whose color values you want to retrieve.
index
- The first color value to retrieve. To retrieve the first color value in the color set, specify 1 for this parameter.
count
- The number of color values to retrieve. Specify
gxSelectToEnd
to retrieve all color values in the color set including and beyondindex
.space
- A pointer to a color space value. On return, specifies the color space for the source color set.
data
- An array of
gxSetColor
color values. On return, contains the specified subset of color values from the source color set.- function result
- The number of color values in the range specified by
index
andcount
.DESCRIPTION
TheGXGetColorSetParts
function retrieves the specified color values from the source color set and returns them in thedata
array. It also returns the color set's color space in the location pointed to by thespace
parameter. The function result is the number of color values copied into thedata
array.Before calling
GXGetColorSetParts
, you must allocate an array of sufficient size to hold the specified number of color values. If instead you passnil
for thedata
parameter, the function does not return any color values, but nonetheless returns (as
its function result) the number of colors in the specified range. Thus you can make an initial call toGXGetColorSetParts
to determine the size of the array to allocate, and then call it once more to get the color values themselves.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory colorSet_is_nil index_is_less_than_one (debugging version) count_is_less_than_one (debugging version) Warnings index_out_of_range count_out_of_range SEE ALSO
To retrieve the entire array of color values from a color set object, use theGXGetColorSet
function, described on page 4-73. To replace the entire array of color values in a color set object, use theGXSetColorSet
function, described in the previous section. To replace some of the color values in a color set object, use theGXSetColorSetParts
function, described in the next section.The
gxSetColor
union is described on page 4-56.